<template>
  <el-form-item v-show="isShow" :label="i18nt('designer.setting.minValue')">
    <el-input-number
      v-model="optionModel.min"
      class="hide-spin-button"
      style="width: 100%"
    ></el-input-number>
  </el-form-item>
</template>

<script>
export default {
  name: 'MinEditor',
  props: {
    designer: Object,
    selectedWidget: Object,
    optionModel: Object
  },
  computed: {
    isShow() {
      // 当组件为 number , 并且 isInput 为 0 时，不显示
      if (
        this.selectedWidget &&
        this.selectedWidget.type === 'number' &&
        this.selectedWidget.options.isInput === 0
      ) {
        return false
      }

      // 当组件为 number , 并且 isInput 为 0 时，不显示
      if (
        this.selectedWidget &&
        this.selectedWidget.type === 'text' &&
        this.optionModel.isInput === 0
      ) {
        return false
      }

      return true
    }
  }
}
</script>

<style scoped></style>
